package com.xbjtech.util;

import java.util.Random;

public class StringUtils {
	
	/**
	 * 0-9
	 * 随机产生指定位数的验证码
	 * @param wei 位数
	 * @return 验证码
	 */
	public static String randomYzm(int wei) {
		Random random = new Random();
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < wei; i++) {
			sb.append(random.nextInt(10));
		}
		return sb.toString();
	}
	
	public static void main(String[] args) {
		System.out.println(randomYzm(6));
	}

}
